using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class vtQ_What_customers_are_sharing__the__same_AR_accountsMap : EntityTypeConfiguration<vtQ_What_customers_are_sharing__the__same_AR_accounts>
    {
        public vtQ_What_customers_are_sharing__the__same_AR_accountsMap()
        {
            // Primary Key
            this.HasKey(t => new { t.First_Customer, t.Second_Customer, t.Common_AR_Account });

            // Properties
            this.Property(t => t.First_Customer)
                .IsRequired()
                .HasMaxLength(6);

            this.Property(t => t.Second_Customer)
                .IsRequired()
                .HasMaxLength(6);

            this.Property(t => t.Common_AR_Account)
                .IsRequired()
                .HasMaxLength(40);

            // Table & Column Mappings
            this.ToTable("vtQ_What_customers_are_sharing_ the_ same_AR_accounts");
            this.Property(t => t.First_Customer).HasColumnName("First Customer");
            this.Property(t => t.Second_Customer).HasColumnName("Second Customer");
            this.Property(t => t.Common_AR_Account).HasColumnName("Common AR Account");
        }
    }
}
